﻿using UnityEngine;
using System.Collections;

public class WireLinear : Wire {
	
	public Neuron neuronInput;
	public Neuron neuronOutput;
	
	public float slope = 1;
	public float midpoint = 0.5f;
	public float noise = 0;
		
	public ushort probeInputAxon;
	public float probeInputFloat;
	public float probeOutputFloat;
	public ushort probeOutputSoma;
	
	void FixedUpdate () {

		float v = 0;
		probeInputAxon = neuronInput.axon;
		v = neuronInput.axon / 65534.0f;
		v = Mathf.Clamp01 (v);
		probeInputFloat = v;

		v = midpoint + (v - 0.5f) * slope + Random.Range (-noise, noise);
		v = Mathf.Clamp01 (v);
		probeOutputFloat = v;

		neuronOutput.soma = (ushort)(v * 65534.0f);		

	}


	
}
